<template>
    <div class="body">
        <div class="merchant-top" ref="merchanttop">
            <text class="myIconfont common-icon" @click="back">&#xe660;</text>
            <text class="myfont top-title">{{gT('choiseBarber')}}</text>
        </div>
        <scroller class="myscroll">
            <!-- barber list ug -->
            <div class="barbers-box" v-if="lang==1">
                <div class="one-barber" v-for="(item,index) in barberList" @click="choiseServer(index)">
                    <div class="barber-top">
                        <div class="star-box">
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                        </div>
                        <div class="barber-nameImg">
                            <text class="myfont barber-name">{{item.name}}</text>
                            <image class="barber-img" :src="barberImg"></image>    
                        </div>
                    </div>
                    <div class="barber-bottom">
                        <div class="time-box">
                            <div class="times-list">
                                <text class="one-time">22:00</text>    
                                <text class="one-time">20:00</text>    
                                <text class="one-time">18:00</text>    
                                <text class="one-time">16:00</text>    
                                <text class="one-time">14:00</text>    
                            </div>
                            <text class="myfont common-text">بۈگۈن</text>
                        </div>
                        <div class="time-box">
                            <div class="times-list">
                                <text class="one-time myfont">بوش</text>    
                            </div>
                            <text class="myfont common-text">ئەتە</text>
                        </div>
                    </div>
                </div>
            </div>
            <!-- barber list ug -->
            <div class="barbers-box" v-else>
                <div class="one-barber" v-for="(item,index) in barberListCn" @click="choiseServer(index)">
                    <div class="barber-top">
                        <div class="barber-nameImg">
                            <image class="barber-img" :src="barberImg"></image>    
                            <text class="myfont barber-name barber-name-zh">{{item.name}}</text>
                        </div>
                        <div class="star-box star-box-zh">
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                            <text class="myIconfont common-star">&#xe6c9;</text>
                        </div>
                    </div>
                    <div class="barber-bottom">
                        <div class="time-box time-box-zh">
                            <text class="myfont common-text common-text-zh">今天</text>
                            <div class="times-list times-list-zh">
                                <text class="one-time one-time-zh">14:00</text>    
                                <text class="one-time one-time-zh">16:00</text>    
                                <text class="one-time one-time-zh">18:00</text>    
                                <text class="one-time one-time-zh">20:00</text>    
                                <text class="one-time one-time-zh">22:00</text>    
                            </div>
                        </div>
                        <div class="time-box">
                            <text class="myfont common-text common-text-zh">明天</text>
                            <div class="times-list times-list-zh">
                                <text class="one-time one-time-zh myfont">有空</text>    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </scroller>        
    </div>
</template>

<style scoped>
    .body{
        background-color: #f3f3f3;
    }
    /*merchant-top*/
    .merchant-top{
        height: 90px;
        position: fixed;
        top: 0px;
        right: 0px;
        left: 0px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        background-color:#fff;
        z-index: 100;
        box-shadow:0px 5px 10px #ddd;
    }
    .common-icon{
        color: #000;
        font-size: 36px;
        height: 90px;
        width: 90px;
        flex-direction: row;
        align-items: center;
        justify-content:center;
        position: absolute;
        left: 0px;
    }
    .top-title{
        color: #000;
        font-size: 30px;
    }
    .myscroll{
        position: fixed;
        top: 90px;
        bottom: 0px;
        right: 0px;
        left: 0px;
    }
    /*barbers-box*/
    .barbers-box{
        padding-right: 25px;
        padding-left: 25px;
    }
    .one-barber{
        width: 700px;
        height: 230px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        overflow: hidden;
        box-shadow:0px 0px 15px #ddd;
        margin-top: 48px;
    }
    .barber-top{
        height: 100px;
        width: 700px;
        background-color: #f7f7f7;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .barber-nameImg{
        flex-direction: row;
        height: 100px;
        align-items: center;
    }
    .barber-name{
        color: #000;
        font-style:30px;
        margin-right: 25px;
    }
    .barber-name-zh{
        margin-right: 0px;
        margin-left: 25px;
    }
    .barber-img{
        width: 100px;
        height: 100px;
    }
    .star-box{
        flex-direction: row;
        margin-left: 25px;
    }
    .star-box-zh{
        margin-left: 0px;
        margin-right: 25px;
    }
    .common-star{
        color: #ffaa00;
        padding-right: 3px;
        padding-left: 3px;
    }
    .barber-bottom{
        height: 130px;
        width: 700px;
        background-color: #fff;
        padding-top: 30px;
        padding-bottom: 30px;
        padding-right: 25px;
        padding-left: 25px;
    }
    .time-box{
        flex-direction: row;
        justify-content: flex-end;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }
    .time-box-zh{
        justify-content: flex-start;
    }
    .times-list{
        flex-direction: row;
        flex-wrap: wrap;
        width: 560px;
        justify-content: flex-end;
    }
    .times-list-zh{
        justify-content: flex-start;
    }
    .one-time{
        margin-left: 30px;
        font-size: 28px;
    }
    .one-time-zh{
        margin-left: 0px;
        margin-right: 30px;
    }
    .common-text{
        color: #000;
        font-size: 28px;
        margin-left: 25px;
        width: 60px;
        flex-direction: row;
        justify-content: flex-end;
    }
    .common-text-zh{
        justify-content: flex-start;
        margin-left: 0px;
        margin-right: 25px;
    }
    
    .myfont{
        font-family: 'myfont';
        white-space: nowrap;
    }
    .myIconfont{
        font-family: 'iconfont';
    }
</style>

<script>
    // 全局变量
    var self;
    const dom = weex.requireModule('dom');
    var storage = weex.requireModule('storage');
    var wxrouter;
    module.exports = {
        //动态数据属性
        data : function () {
            return {
              barberImg:'',
              barberList:[
                {
                    "name":"سىناق"
                },
                {
                    "name":"سىناق"
                },
                {
                    "name":"سىناق"
                }
              ],
              barberListCn:[
                {
                    "name":"测试"
                },
                {
                    "name":"测试"
                },
                {
                    "name":"测试"
                }
              ]
            }
        },
        //公开数据属性
        props : {
           // lang: {
           //     default: 'ug'
           // },
        },
        //组件头文件导入
        components: {
            // fix_loading: require('../fix_loading/fix_loading.vue')
        },
        //组件实例创建完成，属性已绑定，但DOM还未生成
        created() {
            self = this;
            wxrouter = weex.requireModule('wxrouter');

            dom.addRule('fontFace', {
                'fontFamily': "myfont",
                'src': "url(" + self.gFontUrl + ")"
            });

            var icon_font = self.gIconFontUrl;
            dom.addRule('fontFace', {
                'fontFamily': "iconfont",
                'src': "url('" + icon_font + "')"
            });

            self.lang=self.gLang;
            self.barberImg = self.gImageUrl + 'c.jpg';

        },
        //方法，函数
        methods: {
            choiseServer:function(e){
                console.log("choiseServer");
            },
            back:function(){
                wxrouter.popViewController();
            }
        }
    }
</script>
